Skip to content

ci: add typecheck step and fix existing type errors (#469) - #485

Open
ayanasarkar wants to merge 1 commit into
AOSSIE-Org:mainfrom
ayanasarkar:fix/ci-typecheck-469
Open

ayanasarkar wants to merge 1 commit into
AOSSIE-Org:mainfrom
ayanasarkar:fix/ci-typecheck-469

Conversation

@ayanasarkar

@ayanasarkar ayanasarkar commented Nov 15, 2026 •

Copy link
Copy Markdown

Fixes #469

Description

vite build doesn't type-check and there was no typecheck script, so type
errors could never fail CI. On current main, npx tsc --noEmit reports 9 errors
from two root causes:

Changes:

  • Add "typecheck": "tsc --noEmit" and run npm run typecheck in CI (after Biome, before tests).
  • Import execSync in gstManager.ts.
  • MockChildProcess now extends the real ChildProcess with real PassThrough
    stdin/stdout, so no as casts or ! assertions are needed (per AGENTS.md).
    Test behavior is unchanged, and the stdin.end spy is kept.
  • Document the new check in AGENTS.md and CONTRIBUTING.md.

Evidence

Before (main @ a31bc71), npx tsc --noEmit:

src/server/gstreamer/gstManager.ts(99,17): error TS2304: Cannot find name 'execSync'.
src/server/clipboard.test.ts(66,4 / 77,36 / 87,4 / 106,36 / 123,25 / 124,25 / 139,25 / 140,25):
  error TS2740: Type 'MockChildProcess' is missing the following properties from type 'ChildProcess'
Found 9 errors in 2 files.

After: npm run typecheck exits 0. npx @biomejs/biome ci ., npm test (31/31)
and npm run build also pass.

I also checked that the new step really blocks errors: adding a file with
const x: number = "oops" made npm run typecheck fail with TS2322, and
removing it made it pass again.

Functional Verification

Tooling/CI change only, with no client, gesture or input behavior modified, so
the device checkboxes are intentionally left unticked.

AI Usage Disclosure

used it for minor fixes and reviewing the diffs.

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • If applicable, I have made corresponding changes or additions to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

Summary by CodeRabbit

  • Chores
    • TypeScript type checking now runs as part of the automated validation workflow, alongside formatting checks and tests.
  • Documentation
    • Contributor instructions and the pull request checklist now include type checking.
  • Tests
    • Updated test coverage for session cleanup and clipboard handling to use revised test setup.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "instructions" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

The package adds a no-emit TypeScript check. CI runs the check, and contributor guidance adds it to required checks. Test updates change a timer callback and replace the clipboard child-process mock with a ChildProcess subclass.

Changes

TypeScript checks

Layer / File(s) Summary
Add typecheck command and update test mocks
package.json, src/server/signalling/handlers/sessionStore.test.ts, tests/server/clipboard.test.ts
The package adds a typecheck script that runs tsc --noEmit. The cleanup test wraps its timer callback. Clipboard tests use a ChildProcess subclass with PassThrough streams and spy on stdin’s end method.
Run and document typechecking
.github/workflows/ci.yml, AGENTS.md, CONTRIBUTING.md
CI runs npm run typecheck after Biome Check and before Tests. The agent and contributor instructions add the command to their check requirements.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Medium

Suggested labels: Typescript Lang, Documentation

Suggested reviewers: siddharthsai218, imxade

Merge Risk: Minimal · up to ece9c

This adds a TypeScript typecheck to CI and contributor guidance, and adjusts test mocks to satisfy it. It does not change runtime behavior. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title 'ci: add typecheck step and fix existing type errors (#469)' matches the main changes: a new typecheck script and CI step, plus fixes for the existing TS2304 and TS2740 errors. It is specifi…
Description check Passed The description follows the template's main sections: it links the issue (Fixes #469), explains the change, gives verification evidence, and includes a checklist. The functional verification section i…
Linked Issues check Passed [#469] The head adds a typecheck script for tsc --noEmit and a CI step that runs it after Biome and before tests (per the raw summary of package.json and ci.yml). The test mock is fixed: `tests/se…
Out of Scope Changes check Passed The changes map to #469 and #450. The package.json script, the ci.yml step, and the AGENTS.md and CONTRIBUTING.md documentation implement or describe the typecheck requirement. The `tests/server/c…
Full details: Title check

Explanation

The title 'ci: add typecheck step and fix existing type errors (#469)' matches the main changes: a new typecheck script and CI step, plus fixes for the existing TS2304 and TS2740 errors. It is specific and conventional. The issue number suffix is optional metadata and does not reduce relevance.

Full details: Description check

Explanation

The description follows the template's main sections: it links the issue (Fixes #469), explains the change, gives verification evidence, and includes a checklist. The functional verification section is not ticked, but the author explains that this is a tooling-only change with no client or input behavior modified. The screenshots section is omitted, which is acceptable because the change has no UI. The AI Usage Disclosure is vague ('used it for minor fixes and reviewing the diffs') and has a grammar gap. The template's 'Addressed Issues' heading is renamed, and the 'Screenshots' and 'Additional Notes' headings are missing. These are non-critical gaps.

Full details: Linked Issues check

Explanation

[#469] The head adds a typecheck script for tsc --noEmit and a CI step that runs it after Biome and before tests (per the raw summary of package.json and ci.yml). The test mock is fixed: tests/server/clipboard.test.ts at head defines MockChildProcess extends ChildProcess with PassThrough stdin and stdout, with no as casts or ! assertions. This addresses the eight TS2740 errors. The PR description gives the path src/server/clipboard.test.ts, but that path does not exist at head. The file is tests/server/clipboard.test.ts. The content matches the description, so this is a documentation mismatch only. [#450] src/server/gstreamer/gstManager.ts at head imports execSync from node:child_process, which resolves the TS2304 error and the Linux ReferenceError. The author reports that npm run typecheck exits 0. I did not run the commands, so that result rests on the author's report. #456 is a separate issue and is not required here.

Full details: Out of Scope Changes check

Explanation

The changes map to #469 and #450. The package.json script, the ci.yml step, and the AGENTS.md and CONTRIBUTING.md documentation implement or describe the typecheck requirement. The tests/server/clipboard.test.ts rewrite fixes the mock types required by #469. Its node:child_process mock now spreads importOriginal, which keeps ChildProcess available. The gstManager.ts change is the single import required by #450. The src/server/signalling/handlers/sessionStore.test.ts change wraps onTimeout in an arrow callback. This is a test-only change with no behavior difference. The PR description does not explain it, but it is small and sits within the test-suite type health that the new typecheck gate covers. No unrelated functional change was found.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the types at dawn,
Then hops where CI carries on.
Through streams of code, the tests run clear,
A tidy checklist now draws near,
And carrots wait when checks are done.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a9d704e and ece9c11.

Files selected for processing: 2

  • src/server/signalling/handlers/sessionStore.test.ts
  • tests/server/clipboard.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@ayanasarkar

Copy link
Copy Markdown
Author

@PinJinx PTAL

@github-actions

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@github-actions

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CI never runs a TypeScript typecheck; main fails tsc --noEmit with 9 errors

1 participant